//
//  MutipleLineChartViewController.m
//  饼线柱状图
//
//  Created by ma c on 14/8/18.
//  Copyright © 2018年 子房. All rights reserved.
//

#import "MutipleLineChartViewController.h"
#import "SSWMutipleLineChart.h"
@interface MutipleLineChartViewController ()<SSWChartsDelegate>

@end

@implementation MutipleLineChartViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [self makeTheMutipleLine];
}

-(void)makeTheMutipleLine
{
    SSWMutipleLineChart * mutipleLine = [[SSWMutipleLineChart alloc] initWithChartType:SSWChartsTypeLine];
    mutipleLine.backgroundColor = [UIColor orangeColor];
    mutipleLine.xValuesArr = [@[@"2015",@"2016",@"2027",@"2018",
                                @"2019",@"2020",@"2021",@"2022",
                                @"2023",@"2024",@"2025",@"2026"] mutableCopy];
    mutipleLine.yValuesArr = [@[@[@"200",@"90",@"150"],
                                @[@"80",@"210",@"250"],
                                @[@"100",@"200",@"300"],
                                @[@"200",@"150",@"30"],
                                @[@"70",@"50",@"335"],
                                @[@"90",@"200",@"220"],
                                @[@"190",@"200",@"170"],
                                @[@"160",@"450",@"235"],
                                @[@"150",@"330",@"368"],
                                @[@"160",@"222",@"258"],
                                @[@"100",@"198",@"263"],
                                @[@"170",@"192",@"356"],] mutableCopy];
    mutipleLine.legendTitlesArr =[ @[@"小麦",@"玉米",@"大豆"] mutableCopy];
    mutipleLine.unit = @"吨";
    mutipleLine.delegate = self;
    mutipleLine.frame = CGRectMake(0, 100, self.view.bounds.size.width, 300);
    mutipleLine.barColorArr = [@[[UIColor greenColor],[UIColor blueColor],[UIColor redColor]] mutableCopy];
    [self.view addSubview:mutipleLine];
    
}

-(void)SSWChartView:(SSWCharts *)chartView didSelectMutipleBarChartIndex:(NSArray *)index
{
    NSLog(@"点击了(%d,%d)",[index[0] intValue],[index[1] intValue]);
}

@end
